﻿using System.Configuration;

namespace FrontDisplay.Weather
{
    public sealed class Configuration : ApplicationSettingsBase
    {
        [UserScopedSetting]
        public City City
        {
            get
            {
                if (this["City"] == null)
                {
                    return new City("Saint Petersburg, Russia", "RSXX0091");
                }
                return (City)this["City"];
            }
            set
            {
                this["City"] = value;
            }
        }

        [UserScopedSetting]
        public HotkeyInfo ShowWeatherHotkey
        {
            get
            {
                if (this["ShowWeatherHotkey"] == null)
                {
                    return new HotkeyInfo { Win = true, Shift = true, Key = System.Windows.Input.Key.W };
                }
                return (HotkeyInfo)this["ShowWeatherHotkey"];
            }
            set
            {
                this["ShowWeatherHotkey"] = value;
            }
        }

        [UserScopedSetting]
        [DefaultSettingValue("true")]
        public bool IsCelsius
        {
            get
            {
                return (bool)this["IsCelsius"];
            }
            set
            {
                this["IsCelsius"] = value;
            }
        }

    }
}
